package com.example.testProject.domain.vo.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户列表Vo
 *
 * @author czx
 * @date 2022/9/23 17:37
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ListVo {

    /**
     * 用户列表信息
     */
    private List<Meta> userList;

    @Data()
    @EqualsAndHashCode(callSuper = false)
    @Accessors(chain = true)
    public static class Meta {

        /**
         * //主键ID
         */
        @JsonSerialize(using = ToStringSerializer.class)
        private Long id;

        /**
         * //用户名
         */
        private String name;

        /**
         * //年龄
         */
        private Integer age;

        /**
         * //邮箱
         */
        private String email;

        /**
         * //更新时间
         */
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updateTime;

        /**
         * //创建时间
         */
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createTime;
    }
}
